//
//  Etat.h
//  Taquin
//
//  Created by Benjamin Bouachour on 13/08/11.
//  Copyright 2011 Epitech. All rights reserved.
//

#ifndef _ETAT_H
#define _ETAT_H

#include <Vector>
#include <iostream>
#include <math.h>

#include "ListAdjacence.h"
#include "../deff.h"

//class AffResult;
class Etat;

#include "../AffResult.h"

using namespace std;

typedef map< pair<int, int>, string> tgrid;
typedef map<int, Etat*> evoisins;


class Etat {
//    ListAdjacence listAdjacence;
    Etat *parent;
    tgrid taquinGrid;
    evoisins voisins;
    int qualite;
    int d;
    int c;
    int size;
    pair<int, int> blank_coord;
    
    string *error;
    
    
    const void constructList();

    
public:
    Etat();
    Etat(const Etat *etat);
//    Etat(ListAdjacence &list);
    Etat(Etat *_parent, const tgrid &grid);
    Etat(const tgrid &grid);
    
    Etat & operator=(const Etat& o);
    const bool operator==(const Etat& o);
    ~Etat();
    
    const void fillListVoisins();
    const void fillListVoisins(const tgrid &grid);
//    
    const int &getQualite() const;
    const void setQualite(const int &_qualite);
    
    const Etat *getParent() const;
    const void setParent(Etat *_parent);
    
    const evoisins &getListVoisins()const;
    const void setListVoisins(const evoisins &list);

    const tgrid &getGrid()const;
    const void setGrid(const tgrid &list);


    const pair<int, int> &getBlank() const;
    const int &getSize() const;

    const void searchBlank();
    
    const int &getCost() const;
    const void setCost(const int &_qualite);
    const int &getDistance() const;
    const void setDistance(const int &_qualite);
    
    
    
};

#endif